;; depends on std-numbers.scm

(define (to-binary^ n)
  (if (zero? n)
      '()
      (if (even? n)
          (cons '0 (to-binary^ (quotient n 2)))
          (cons '1 (to-binary^ (quotient n 2))))))

(define (to-binary n) (reverse (to-binary^ n)))
